home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ultra250.zip / UW_HELP1.HLP < prev    next >
Text File  |  1992-11-03  |  31KB  |  715 lines

  1. `co(4,7);─────────────────────────── /// Structures/Globals ───────────────────────────`color();
  2.  
  3.  ┌──────────────────────────────────────────────────────────────────────────┐    
  4.  │                  `keyword(RECT,/// RECT);                                                         `keyword(WINDOW,/// WINDOW);                                                     │
  5.  │                  `keyword(EVENT,/// EVENT);                                                      `keyword(M_RESET,/// M_RESET);                                               │
  6.  │                  `keyword(M_LOC,/// M_LOC);                                                      `keyword(M_MOVE,/// M_MOVE);                                                  │
  7.  │                  `keyword(PRINT,/// PRINT);                                                      `keyword(MENU,/// MENU);                                                      │
  8.  │                  `keyword(Video Globals,/// Video Globals);                                      `keyword(Event Globals,/// Event Globals);                                      │
  9.  │                  `keyword(Default Attributes,/// Default Attributes);                             `keyword(Cursor Globals,/// Cursor Globals);                                    │
  10.  │                  `keyword(DesqView Globals,/// DesqView Globals);                                 `keyword(Manager Globals,/// Manager Globals);                                 │
  11.  │                  `keyword(Function Globals,/// Function Globals);                                 `keyword(Printer Globals,/// Printer Globals);                                 │
  12.  │                  `keyword(Timer Globals,/// Timer Globals);                                    `keyword(Graphics Globals,/// Graphics Globals);                                 │
  13.  │                  `keyword(EGA/VGA Globals,/// EGA/VGA Globals);                                                                                                   │
  14.  └──────────────────────────────────────────────────────────────────────────┘
  15.  
  16.       These are the structures and global variables that are used in the
  17.     UltraWin library.  The structures defined are used for windowing, mouse
  18.     and printer support.  The globals are used for screen and video,
  19.     Desqview/Windows compatibility, graphics, timer and sound control,
  20.     background processing, dynamically queued RAM-based or disk-based
  21.     printing, and the window manager.  Include the UW.H file for access to the
  22.     structures, and the UW_GLOBX.H file for access to the globals.
  23.  
  24. `co(10,1);/// RECT`co();
  25. `co(11,1);  typedef struct rect_struct
  26.     {
  27.         int x_min, x_max, y_min, y_max;
  28.     } RECT;`co();
  29.  
  30.       This structure is used for general screen and window area definition,
  31.     and is used internally by the WINDOW structure.  We supply several useful
  32.     rectangle functions you may wish to utilize in your own code.  Refer to
  33.   the `keyword(Rectangle Functions,[uw_help4.hlp]/// Rectangle Functions); section for more information.
  34.  
  35. `co(10,1);/// WINDOW`co();
  36.  
  37. `co(15,?);  typedef struct w_struct
  38.     {
  39.         struct w_struct    *next;                         /* next window in linked list      */
  40.         struct w_struct    *previous;                 /* previous window in list                */
  41.         RECT                        pane;              /* the window rectangle          */
  42.         RECT                        old_pane;          /* for full size toggle          */
  43.         int                            rows;                             /* save buffer rows and columns    */
  44.         int                            cols;
  45.         int                         csr_x;             /* the "soft" cursor location    */
  46.         int                         csr_y;
  47.         uchar                        att;               /* the window's attribute        */
  48.         uchar                        bdr_att;           /* the window's border attribute */
  49.         int                         bdr_style;         /* the border style              */
  50.         int                         name_loc;                     /* CENTERED, LEFTJUST, RIGHTJUST    */
  51.         char                        *name;             /* pointer to window name        */
  52.         uchar                        *save;                         /* pointer to save buffer area        */
  53.         uchar                        *buff;                         /* pointer to write buffer area    */
  54.         uchar                        *mask;                         /* pointer to window buffer mask    */
  55.  
  56.         uchar           *tabs;                         /* tab stops                     */
  57.         int                            reg_s, reg_e;             /* scroll region start and end        */
  58.  
  59.         unsigned                hidden            : 1;   /* 1 if window hidden            */
  60.         unsigned                overlapped    : 1;   /* 1 if window overlapped        */
  61.         unsigned                csr_adv            : 1;     /* 1 if cursor auto advanced         */
  62.         unsigned                 inside      : 1;     /* 1 if bordered and inside          */
  63.         unsigned                 mask_on     : 1;     /* 1 if window mask is active        */
  64.         unsigned                popup                :    1;     /* 1 if window is popup                    */
  65.         unsigned                 scroll      : 1;     /* 1 if window auto-scrolls            */
  66.         unsigned                bs_clear        : 1;     /* 1 if backspace is destructive    */
  67.  
  68.         unsigned                eol_wrap        : 1;     /* 1 if cursor wraps at end of ln*/
  69.         unsigned                 mgr_flag    : 1;     /* 1 if win in manager's list      */
  70.         unsigned                 set_flag    : 1;     /* 1 if window is set on screen  */
  71.         unsigned                 cr_flag     : 1;     /* 1 if cr processed                */
  72.         unsigned                 lf_flag     : 1;     /* 1 if lf processed                */
  73.         unsigned                 cr_lf_flag  : 1;     /* 1 if cr or lf act as cr/lf         */
  74.         unsigned                 bk_flag     : 1;     /* 1 if backspace processed      */
  75.         unsigned                 tab_flag    : 1;     /* 1 if tab processed            */
  76.  
  77.         unsigned                 bell_flag   : 1;     /* 1 if bell char processed      */
  78.         unsigned                w_wrap            : 1;     /* 1 if word wrap on                         */
  79.         unsigned                unused            : 14;
  80.  
  81.         void            *usr_ptr;            /* user expansion pointer        */
  82.         uchar           usr_exp[4];                 /* user expansion space                    */
  83.                                        /* DO NOT USE BELOW VARIABLES    */
  84.         void            *sys_ptr;          /* system expansion pointer      */
  85.         uchar           sys_exp[4];                 /* system expansion space                */
  86.     } WINDOW;`co();
  87.  
  88.         This structure is used by the UltraWin library for all window
  89.     operations.  The structure is used internally by the library, so the
  90.     information above is mainly shown to satisfy any curiosity.
  91.  
  92.     Starting with version 2.00 of UltraWin, the tabs for the window are
  93.     allocated on window creation.  The tabs are now as large as the width of
  94.     the window, saving space over the 132 bytes used by previous versions. You
  95.     will notice that starting with 2.00 both user-defined and system pointers
  96.     and expansion areas have been added.  Please do not access the system
  97.     additions as we will be using these in future versions.
  98.  
  99.       It is recommended that these structure elements be accessed by the
  100.     functions provided, where available, and not directly.    This allows us to
  101.     change and enhance the package in the future while maintaining
  102.     compatibility with your code.
  103.  
  104. `co(10,1);/// EVENT`co();
  105. `co(11,1);  typedef struct event_struct
  106.     {
  107.         int         is_mouse;
  108.         int         key;
  109.         int         mod;
  110.         int         m_x, m_y;
  111.         int         m_count, m_button;
  112.     } EVENT;`co();
  113.  
  114.         This structure is used by the global variable "Event", which is used by
  115.     wait_event and event_pending to return information.
  116.     
  117.       The "is_mouse" member is used as a boolean to indicate if the event was
  118.     a keyboard event (is_mouse=0) or a mouse event (is_mouse=1).
  119.     
  120.       The "key" member will contain the key value, and the member "mod" will
  121.     contain bit settings to indicate if a key combination was used. This
  122.     includes the left and right shift combinations, Ctrl or Alt combinations,
  123.     and whether Scroll Lock, Num Lock, or Caps Lock are set (see UW_KEYS.H for
  124.     defines).
  125.     
  126.       The "m_x" and "m_y" members will contain the x,y coordinate (from
  127.     0..V_cols-1 for x, 0..V_rows-1 for y) of the mouse event, "m_count" will
  128.     contain the number of presses, and "m_button" has the define for the
  129.     button pressed (LB, MB, or RB).
  130.  
  131. `co(10,1);/// M_RESET`co();
  132. `co(11,1);  typedef struct reset_struct
  133.     {
  134.         int exists;
  135.         int n_buttons;
  136.     } M_RESET;`co();
  137.  
  138.       This structure is used internally by the init_mouse and end_mouse
  139.     functions. It is used when starting or ending the program, and when first
  140.     called returns whether or not the mouse is available.  The function
  141.     init_mouse uses this structure to set the global Mouse_exists boolean
  142.     variable.
  143.  
  144. `co(10,1);/// M_LOC`co();
  145. `co(11,1);  typedef struct loc_struct
  146.     {
  147.         int button_status;
  148.         int count;
  149.         int col;
  150.         int row;
  151.     } M_LOC;`co();
  152.     
  153.       This structure is used by m_pos, m_pressed, and m_released, as well as
  154.     internally by event_pending.  If you want to handle the mouse yourself,
  155.     bypassing UltraWin's event handling capability, use the m_pos, m_pressed
  156.     and m_released functions to get mouse pressed and coordinate information
  157.     using a variable of type M_LOC.
  158.  
  159. `co(10,1);/// M_MOVE`co();
  160. `co(11,1);  typedef struct move_struct
  161.     {
  162.         int h_count;
  163.         int v_count;
  164.     } M_MOVE;`co();
  165.  
  166.       This structure is used only by the m_motion function, which reports the
  167.     net movement of the mouse cursor between m_motion calls.
  168.  
  169. `co(10,1);/// MENU`co();
  170. `co(11,1);  typedef struct menu_struct
  171.     {
  172.         WINDOW        *wnp;                                          /* the window for output            */
  173.         int              direction;                              /* menu direction, vt or hz   */
  174.         int              num_entries;                          /* number of entries in menu    */
  175.         uchar            csr_att;                                  /* the cursor attribute                */
  176.         uchar            first_att;                              /* the first letter attribute    */
  177.         int                csr_pos;                                  /* current cursor position        */
  178.         uchar            first_pos[M_MAX_ENTRIES]; /* first letter position      */
  179.         int             id[M_MAX_ENTRIES];              /* id value for each entry        */
  180.         uchar            x[M_MAX_ENTRIES];                  /* x location for each entry    */
  181.         char            *entry[M_MAX_ENTRIES];      /* array of char pointers            */
  182.     } MENU;`co();
  183.     
  184.         This structure is used internally by the UltraWin menuing functions. The
  185.     function `keyword(menu_create,[uw_help4.hlp]/// menu_create); sets up the window, direction, and attribute members,
  186.     while `keyword(item_add,[uw_help4.hlp]/// item_add); sets the entry string, id, first position for the hot key,
  187.     the x position (used when the menu is horizontal) and increments
  188.     num_entries.  Once the menu has been constructed with menu_create and
  189.     item_add, you may modify the structure directly to change colors, first
  190.     positions for hot keys, or an id or menu string on the fly.
  191.  
  192.         For example, to change the third entry of the menu pointed to by mnp to
  193.     the words "Load File" with the 'F' character as the hot key with an id
  194.     of 32, use:
  195.     
  196.     mnp->first_pos[2] = 5;                                /* first letter in "File"            */
  197.     mnp->id[2] = 32;                                            /* the new id                                    */
  198.     mnp->entry[2] = "Load File";                    /* the new string                            */
  199.  
  200. `co(10,1);/// PRINT`co();
  201. `co(11,1);  typedef struct printer
  202.   {
  203.       int   active;                                  /* set to 1 if printer init'd/active    */
  204.       int   halt;                   /* set to 1 to temporarily stop printer */
  205.       int   prt_dev;                /* file handle for printer device                */
  206.       char  device[81];             /* name of printer device               */
  207.       int   prt_buff[2];                      /* file handles for printer buffer            */
  208.       char  buffer[81];             /* name of printer buffer               */
  209.       int   cr_cnt;                 /* number of carriage returns to send   */
  210.       int   lf_cnt;                     /* number of line feeds to send         */
  211.       int   block_mode;                          /* allows faster output on block devices*/
  212.  
  213.     long  max_que_size;                      /* maximum size of print que                      */
  214.       long  init_que_size;                  /* initial size of print que                        */
  215.         long  curr_que_size;                  /* current size of print que                        */
  216.         long  read;                                      /* print que read  index                */
  217.         long  write;                  /* print que write index                */
  218.         long  cnt;                    /* print que cnt (number of bytes in q) */
  219.  
  220.         uchar *que;                          /* pointer to print que data            */
  221.         uchar *xlat;                  /* pointer to translation table                    */
  222.         int   xlat_flag;              /* translation flag                                            */
  223. } PRINT;`co();
  224.  
  225.       This structure is used by the print routines in UW_PRINT.C.  For further
  226.     information, see `keyword(Print Support,[uw_help6.hlp]/// Print Support);.
  227.  
  228. `co(10,1);/// Video Globals`co();
  229. `co(11,1);    uchar far *Screen;`co();
  230.     
  231.       This is a far pointer to the video display area.    Its value will depend
  232.     on if you are using a monochrome or color display, and whether a control
  233.     program like Windows or Desqview is being used.  You may modify this
  234.     variable to redirect output anywhere in memory, but be careful to use an
  235.     area you are sure is safe.
  236.  
  237. `co(11,1);    int V_mode;`co();
  238.     
  239.       This is an integer that contains the text mode that was used before the
  240.     call to init_video or force_video.    This is saved in V_mode and is used in
  241.     the call to end_video to restore the original mode.
  242.  
  243. `co(11,1);    int V_cols, V_rows;`co();
  244.  
  245.         These two variables contain the number of columns and rows available on
  246.     the text screen, and are set by the init_video and force_video functions.
  247.     The video screen is therefore defined as 0..V_cols-1 and 0..V_rows-1.
  248.  
  249. `co(10,1);/// Event Globals`co();
  250. `co(11,1);    EVENT Event;`co();
  251.     
  252.         This global variable is used by the event_pending and wait_event
  253.     functions to pass back information about the type of event as well as
  254.     mouse/keyboard information.
  255.  
  256. `co(11,1);    int Mouse_exists;`co();
  257.     
  258.       This global variable is set by the init_mouse function to either TRUE
  259.     (1) or FALSE (0) depending on whether a Microsoft or compatible mouse is
  260.     connected.
  261.  
  262. `co(10,1);/// Default Attributes`co();
  263. `co(11,1);    uchar Dflt_att, Dflt_bdr_att;`co();
  264.     
  265.         These attributes are used to set the default window colors when
  266.     wn_create is called.    If you do not use the wn_color and wn_bdr_color
  267.     macros to set the window colors, you will get these default attributes.
  268.  
  269. `co(10,1);/// Cursor Globals`co();
  270. `co(11,1);  int Csr_visible;`co();
  271.     
  272.         This boolean is either TRUE (1) or FALSE (0) depending on whether the
  273.     hardware cursor is visible.
  274.  
  275. `co(11,1);    int Csr_in_use;`co();
  276.  
  277.         This boolean is either TRUE (1) or FALSE (0) depending on whether the
  278.     hardware cursor is being used.    The window input routines wn_gets and
  279.     wn_gets_ll set this variable to TRUE while the cursor is being used, then
  280.     set it back to FALSE when finished.
  281.  
  282. `co(10,1);/// DesqView Globals`co();
  283. `co(11,1);  int DV_seg, DV_off, DV_flag, DV_upd;`co();
  284.  
  285.         These are integers that are used to maintain DesqView compatibility.
  286.     They are used internal to the library.
  287.  
  288. `co(10,1);/// Manager Globals`co();
  289. `co(11,1);    WINDOW *First_window, *Last_window`co();
  290.  
  291.         These are pointers to the first and last windows in the window manager's
  292.     linked list.  These are NULL on startup, and are set by the link_window and
  293.     unlink_window functions as windows are added to the manager.  You can use
  294.     these to determine the top window (Last_window) or the bottom window
  295.     (First_window) at any time when using the manager.
  296.  
  297. `co(11,1);  int Num_windows`co();
  298.  
  299.     This is a count of the number of windows in the window manager.  It is 0
  300.     on startup, and increments for every link_window call.
  301.  
  302.  
  303. `co(10,1);/// Function Globals`co();
  304. `co(11,1);    int (*Idle_func)(void) `co();
  305.  
  306.       This is the function that UltraWin calls when it is idle, waiting for an
  307.     event.  You may set your own idle function by calling set_idle_func with
  308.     the name of your function.  To take advantage of the background printing
  309.     capability of UltraWin you could call `keyword(set_idle_func,[UW_HELP3.HLP]/// set_idle_func); with the function
  310.     name print_in_background.
  311.  
  312. `co(11,1);    int (*Key_func)(int, int) `co();
  313.  
  314.       This is a function pointer hook into the UltraWin key handler.  It gets
  315.     set by the set_key_func function, and points to a user-defined key routine.
  316.     See `keyword(set_key_func,[UW_HELP3.HLP]/// set_key_func); for further details.
  317.     
  318.  
  319. `co(11,1);    int (*Vld_func)(char*, char*, char*, int, int, WINDOW*) `co();
  320.  
  321.       This is a function pointer to the wn_gets_ll string entry validation
  322.     routine.  It is useful when you want to perform extra error checking
  323.     on a particular field (as in a valid date).  Refer to `keyword(Data Entry,[uw_help4.hlp]/// Data Entry);
  324.     for more information.
  325.  
  326. `co(11,1);  int (*Gets_hook_func)(char*, char*, char*, int, int, int, EVENT*, WINDOW*) `co();
  327.  
  328.         This is a function pointer to the new wn_gets_ll hook.  It is set with
  329.     the set_gets_hook function, and is called from within wn_gets_ll.  With
  330.     this function you can customize wn_gets_ll "on the fly."  The function is
  331.     called on entry, before exiting and on every keystroke.  You can modify
  332.     the passed string, mask and template dynamically, as well as return your
  333.     own key values.  This gives you the ability to customize string entry in
  334.     virtually any way imaginable!  Again refer to `keyword(Data Entry,[uw_help4.hlp]/// Data Entry); for more
  335.     information.
  336.  
  337. `co(10,1);/// Printer Globals`co();
  338. `co(11,1);    PRINT *Printers[MAX_PRINTERS]`co();
  339.  
  340.       This is an array of MAX_PRINTERS (4) pointers to PRINT structures for
  341.     use in UltraWin's powerful print queue routines.  Refer to `keyword(Print Support,[uw_help6.hlp]/// Print Support);
  342.     for more information.
  343.  
  344. `co(10,1);/// Timer Globals`co();
  345. `co(11,1);    int Uw_timers[4]`co();
  346.  
  347.       These are four user timers, which count down toward zero every timer tick
  348.     from the value you set.  For example, if you call init_clock with a value
  349.     of 0x3333, then to set a one second count-down timer, just use
  350.     Uw_timer[1] = 91; and after 91 ticks (one second) this second member of
  351.     the array will reach zero.  This occurs even when you are executing your
  352.     own code as it is modified during the timer interrupt.
  353.  
  354. `co(11,1);    int Sys_timers[2], int Sound_timer`co();
  355.  
  356.       These are timers used internally for system timers and the tone
  357.     function.  Access the Uw_timers rather than these for your own use.
  358.   
  359. `co(11,1);    int Sound_on`co();
  360.  
  361.       This is a boolean variable that is 1 if the PC speaker is currently
  362.     sounding a tone, or 0 if it is off.  This variable is used internally by
  363.     tone.
  364.   
  365. `co(11,1);    ulong Tics`co();
  366.  
  367.       This is an unsigned long which counts the number of timer ticks since
  368.     the call to init_clock.  With init_clock(0x3333), Tics will increment 91
  369.     times every second.  You may access this variable in your own program for
  370.     timing, or reset it to 0 if you want a "count up" timer.
  371.  
  372. `co(11,1);    int Tics_per_sec`co();
  373.  
  374.       This is an integer set in init_clock that specifies the number of ticks
  375.     per second.  For init_clock(0x3333), this number will be 91.
  376.  
  377. `co(10,1);/// Graphics Globals`co();
  378. `co(11,1);    int Graphics`co();
  379.  
  380.       This is a boolean flag set by init_uw_graphics.  When the graphics flag
  381.     is set, all UltraWin output goes through g_ch.  Please refer to
  382.   `keyword(Graphics Support,[uw_help5.hlp]/// Graphics Support); for a complete discussion of using UltraWin in
  383.     graphic modes.
  384.  
  385. `co(11,1);    int G_opt`co();
  386.  
  387.       This is a boolean flag which specifies whether output optimization
  388.     should be performed in g_ch.  If this flag is set, UltraWin checks the
  389.     contents of each cell to see if output is necessary before performing the
  390.     output.  This can result in a very substantial increase in speed.  Again
  391.     refer to `keyword(Graphics Support,[uw_help5.hlp]/// Graphics Support); for more information.
  392.  
  393. `co(10,1);/// EGA/VGA Globals`co();
  394. `co(11,1);    int Ega`co();
  395.  
  396.       This is a boolean which is set to 1 when an EGA board is detected by
  397.     init_video.  A VGA board will cause a value of 0.
  398.  
  399. `co(11,1);    int Vga`co();
  400.  
  401.       This is a boolean which is set to 1 when a VGA board is detected by
  402.     init_video.  An EGA only board will cause a value of 0.
  403.  
  404. `co(11,1);    int EgaVga`co();
  405.  
  406.       This is a boolean which is set to 1 when a board capable of either EGA
  407.     or VGA is detected by init_video.
  408.     
  409.     For more information about EGA/VGA support, see `keyword(Font/EGA Control,[uw_help5.hlp]/// Font/EGA Control);
  410.  
  411. `co(4,7);────────────────────────── /// Video Initialization ──────────────────────────`co();
  412.  
  413. ┌──────────────────────────────────────────────────────────────────────────┐    
  414. │                 `keyword(init_video,/// init_video);                       `keyword(force_video,/// force_video);                       │
  415. │                 `keyword(end_video,/// end_video);                          `keyword(set_vid_addr,/// set_vid_addr);                      │ 
  416. └──────────────────────────────────────────────────────────────────────────┘
  417.  
  418.         These functions allow you to initialize the text screen to a specific
  419.     mode, and return back to the mode in use before the initialization.
  420.     Initialization of the text screen is the first step that should be taken
  421.     in a C program that utilizes the UltraWin library.
  422.     
  423.         The UltraWin library supports 80x25 Monochrome and Color modes, as well
  424.     as the 80x43 EGA color and 80x50 VGA color mode.  Higher resolution text
  425.     screens that some of the new VGA cards can produce are also supported.
  426.  
  427. `co(10,1);/// init_video`co();   `keyword(source,[UW_VID.C]~init_video);
  428.     Initializes the text screen to a specific mode, specified not by mode
  429.     number, but by number of columns and rows.  The video mode that best
  430.     matches the number of columns and rows passed will be selected.  The
  431.     function will set the two global variables V_cols and V_rows to the actual
  432.     number that are available.  This allows the user to specify an 80x50
  433.     screen, and have init_video set the closest text mode to this size that
  434.     your video card will accomodate.
  435.  
  436. Prototype:
  437.     void init_video(int cols, int rows);
  438.  
  439. Parameters:
  440. `co(11,1);    int cols, int rows`co();
  441.         The number of columns and rows desired for the screen.
  442.  
  443. Usage:
  444.     init_video( 80, 50 );
  445.  
  446. `co(10,1);/// force_video`co();   `keyword(source,[UW_VID.C]~force_video);
  447.     This function is similar to init_video, except the text bios mode number
  448.     is passed as well as the number of columns and rows.  This allows one of
  449.     the non-standard VGA modes (specific to your VGA card) to be set.
  450.  
  451. Prototype:
  452.     void force_video( int force_mode, int cols, int rows );
  453.  
  454. Parameters:
  455. `co(11,1);    int force_mode`co();
  456.         The actual mode number listed in the manual for your video board.
  457. `co(11,1);    int cols, int rows`co();
  458.         The number of columns and rows desired for the screen.
  459.  
  460. Usage:
  461.     force_video( 0x60, 132, 60 );
  462.  
  463. `co(10,1);/// end_video`co();   `keyword(source,[UW_VID.C]~end_video);
  464.     Restores the video mode in use before the call to init_video.  Call this
  465.     function just before you exit your program.
  466.  
  467. Prototype:
  468.     void end_video(void);
  469.  
  470. Parameters:
  471.     None.
  472.  
  473. Usage:
  474.     end_video();
  475.  
  476. `co(10,1);/// set_vid_addr`co();   `keyword(source,[UW_VID.C]~set_vid_addr);
  477.     This routine overrides the default video address and sets it to the
  478.     desired segment and offset.
  479.  
  480. Prototype:
  481.     void set_vid_addr( int segment, int offset );
  482.  
  483. Parameters:
  484. `co(11,1);    int segment, offset`co();
  485.         The desired segment and offset for your new video address.
  486.  
  487. Usage:
  488. `co(11,1);    uchar far *old_screen;`co();
  489.     ...
  490.     old_screen = Screen;
  491.     set_vid_addr( 0xB000, 0x8000 );
  492.     ...
  493.     Screen = old_screen;
  494.  
  495. `co(4,7);───────────────────────────── /// Window Basics ──────────────────────────────`co();
  496.  
  497. ┌──────────────────────────────────────────────────────────────────────────┐    
  498. │               `keyword(wn_create,/// wn_create);                     `keyword(wn_set,/// wn_set);                       │
  499. │               `keyword(wn_clear,/// wn_clear);                      `keyword(wn_border,/// wn_border);                    │
  500. │               `keyword(wn_move,/// wn_move);                       `keyword(wn_size,/// wn_size);                      │
  501. │               `keyword(wn_destroy,/// wn_destroy);                                                 │
  502. │               `keyword(set_mask,/// set_mask);                      `keyword(clear_mask,/// clear_mask);                   │
  503. └──────────────────────────────────────────────────────────────────────────┘
  504.  
  505.         These are the functions used for basic window creation, destruction, and
  506.     placement on the text screen.  There are special functions that allow you
  507.     to "mask off" sections of a window so that output does not occur to that
  508.     area, as well as restoring what was behind a window when it was created.
  509.  
  510. `co(10,1);/// wn_create`co();   `keyword(source,[UW_WN.C]~wn_create);
  511.         Creates a window with the size determined by the upper left and lower
  512.     right coordinates passed by integer.  Several border styles can be used,
  513.     as well as a mode for saving what is behind the window, to be restored on
  514.     window destruction.    Please note that wn_create does not allocate the
  515.     window structure for you.  You must declare your window structures as
  516.     either locals or globals, passing the address of the window to wn_create,
  517.     or as pointers returned from malloc or calloc.  A 1 is returned on
  518.     success, and a 0 on failure.
  519.     
  520. Prototype:
  521.     int wn_create( int x_min, int y_min, int x_max, int y_max, int bdr,
  522.                                  int mode, WINDOW *wnp );
  523.  
  524. Parameters:
  525. `co(11,1);    int x_min, int y_min, int x_max, int y_max`co();
  526.         The coordinates of the upper left and lower right corners of the window
  527.         to create.  These range from 0,0 (upper left corner of the screen) to
  528.         the max number of columns and rows minus one (lower right corner of the
  529.         screen).
  530. `co(11,1);    int bdr`co();
  531.         The border style to use, namely one of the defines NO_BDR, SGL_BDR,
  532.         DBL_BDR, SLD_BDR, or DUAL_BDR.
  533. `co(11,1);    int mode`co();
  534.         The popup mode, can be either WN_NORMAL or WN_POPUP.    Normal windows
  535.         when destroyed do not restore what is behind them, while popup windows
  536.         do.  Normal windows therefore use less memory.
  537. `co(11,1);    WINDOW *wnp`co();
  538.         A pointer to the window.    Can be the address of a global variable of
  539.         type WINDOW, or a pointer that has been allocated with malloc or calloc.
  540.         The wn_create function will initialize the contents of the window for
  541.         you, so all that is necessary is to pass it to this function.
  542.  
  543. Usage:
  544.     WINDOW *wnp;
  545.     ...
  546.     wn_create( 0, 0, 79, 24, SGL_BDR, POPUP, wnp );
  547.  
  548. `co(10,1);/// wn_set`co();   `keyword(source,[UW_WN.C]~wn_set);
  549.         Sets the window on the screen, saving the contents of what is behind the
  550.     window if it was defined as WN_POPUP when created with wn_create.
  551.  
  552. Prototype:
  553.     void wn_set( WINDOW *wnp );
  554.  
  555. Parameters:
  556. `co(11,1);    WINDOW *wnp`co();
  557.         A pointer to the window, or address of a WINDOW variable.
  558.  
  559. Usage:
  560.     WINDOW *wnp;
  561.     ...
  562.     wn_set( wnp );
  563.  
  564. `co(10,1);/// wn_clear`co();   `keyword(source,[UW_WN.C]~wn_clear);
  565.         Clears the contents of a window, excluding the border, if present.  The
  566.     window must be first created with wn_create, then set on the video screen
  567.     with wn_set.
  568.  
  569. Prototype:
  570.     void wn_clear( WINDOW *wnp );
  571.  
  572. Parameters:
  573. `co(11,1);    WINDOW *wnp`co();
  574.         A pointer to the window.
  575.  
  576. Usage:
  577.     WINDOW *wnp;
  578.     ...
  579.     wn_clear( wnp );
  580.  
  581. `co(10,1);/// wn_border`co();   `keyword(source,[UW_BDR.C]~wn_border);
  582.         Draws the border to the window, if the window border exists (call
  583.     wn_create with something besides NO_BDR, or set the bdr_style field of the
  584.     window to one of the border defines). Use this function to redraw the
  585.     border.
  586.  
  587. Prototype:
  588.     void wn_border( WINDOW *wnp );
  589.  
  590. Parameters:
  591. `co(11,1);    WINDOW *wnp`co();
  592.         A pointer to the window.
  593.  
  594. Usage:
  595.     WINDOW *wnp;
  596.     ...
  597.     wn_border( wnp );
  598.  
  599. `co(10,1);/// wn_move`co();   `keyword(source,[UW_WN.C]~wn_move);
  600.         Takes a window that has been placed on the video screen with wn_set, and
  601.     moves it to a new location.    Please note that the background will be
  602.     restored for you when the window is moved if you create the window with
  603.     the WN_POPUP value as the mode parameter to wn_create.
  604.  
  605. Prototype:
  606.     void wn_move( int col, int row, WINDOW *wnp );
  607.  
  608. Parameters:
  609. `co(11,1);    int col, row`co();
  610.         The column and row where the window is to be moved.  This location is
  611.         where the upper left hand corner of the window will be placed.
  612. `co(11,1);  WINDOW *wnp`co();
  613.         A pointer to the window to move.
  614.  
  615. Usage:
  616.     WINDOW *wnp;
  617.     ...
  618.     wn_move( 3, 7, wnp );
  619.  
  620. `co(10,1);/// wn_size`co();   `keyword(source,[UW_WN.C]~wn_size);
  621.         Takes a window that has been placed on the video screen with wn_set, and
  622.     resizes it, either smaller or larger.  The window can also be moved in the
  623.     same operation.    Please note that the background will be restored for you
  624.     when the window is sized if you create the window with the WN_POPUP value
  625.     as the mode parameter to wn_create.
  626.  
  627.   IMPORTANT: The contents of the window are destroyed in this operation. 
  628.   Since the window changes size, it is typically necessary to redisplay
  629.   the contents to take advantage of the new size.
  630.  
  631. Prototype:
  632.     int wn_size( int x_min, int y_min, int x_max, int y_max, WINDOW *wnp );
  633.  
  634. Parameters:
  635. `co(11,1);    int x_min, int y_min, int x_max, int y_max`co();
  636.         The coordinates of the upper left and lower right corners of the window
  637.         to create.  These range from 0,0 (upper left corner of the screen) to
  638.         the max number of columns and rows minus one (lower right corner of the
  639.         screen).
  640. `co(11,1);  WINDOW *wnp`co();
  641.         A pointer to the window to move.
  642.  
  643. Usage:
  644.     WINDOW *wnp;
  645.     ...
  646.     wn_size( 3, 7, 74, 18, wnp );
  647.  
  648. `co(10,1);/// set_mask`co();   `keyword(source,[UW_MASK.C]~set_mask);
  649.     Checks to see if the second window (top) overlaps the first window
  650.     (bottom), and masks off (for output) the area that overlaps. Call this
  651.     function when a window is added on top of another window.  If the windows
  652.     are not overlapped, then no masking is necessary, and the mask is not
  653.     performed.    Masking the bottom window prevents output to the region of the
  654.     bottom window overlapped, giving the appearance that the window updates
  655.     "in the background".  Call set_mask on a window for each window that is to
  656.     be displayed "on top" of it.  You do not need to use this function when
  657.     using the window manager, as it takes care of all masking when a window is
  658.     added or removed!
  659.  
  660. Prototype:
  661.     void set_mask( int mode, WINDOW *wnp1, WINDOW *wnp2 );
  662.  
  663. Parameters:
  664. `co(11,1);    int mode`co();
  665.         A value 1 (ON) or 0 (OFF) to indicate if the mask is to be added
  666.         or removed.
  667. `co(11,1);    WINDOW *wnp1`co();
  668.         The window for which the mask is to be set (the bottom window).
  669. `co(11,1);    WINDOW *wnp2`co();
  670.         The window used to set the mask of the bottom window. (the top window).
  671.  
  672. Usage:
  673.     WINDOW bottom_win, top_win;
  674.     ...
  675.     set_mask(ON, &bottom_win, &top_win);
  676.     set_mask(OFF, &bottom_win, &top_win);
  677.  
  678. `co(10,1);/// clear_mask`co();   `keyword(source,[UW_MASK.C]~clear_mask);
  679.         Clears the mask for the window passed.    All areas of the window will
  680.     change when the window is refreshed, or when any information is written to
  681.     the window, the window scrolls, etc. The window manager will clear any
  682.     masks necessary when you add or delete windows.
  683.  
  684. Prototype:
  685.     void clear_mask( WINDOW *wnp );
  686.  
  687. Parameters:
  688. `co(11,1);    WINDOW *wnp1`co();
  689.         A pointer to type WINDOW that specifies the window to clear.
  690.  
  691. Usage:
  692.     WINDOW win;
  693.     ...
  694.     clear_mask( &win );
  695.  
  696. `co(10,1);/// wn_destroy`co();   `keyword(source,[UW_WN.C]~wn_destroy);
  697.         Restores what was behind the window before wn_create (if it was defined
  698.     using WN_POPUP), and deallocates memory used by the window. Be sure you
  699.     destroy any temporary window that you have created with wn_create, or you
  700.     will consume valuable memory.  This is also good practice at the end of
  701.     your program, before calling end_video and returning to DOS.
  702.  
  703. Prototype:
  704.     void wn_destroy( WINDOW *wnp );
  705.  
  706. Parameters:
  707. `co(11,1);    WINDOW *wnp`co();
  708.         A pointer to the window, or address of a WINDOW variable.
  709.  
  710. Usage:
  711.     WINDOW *wnp;
  712.     ...
  713.     wn_destroy( wnp );
  714.  
  715.